﻿Public Class frmSelecaoChampion

#Region "Funções"

    Private Sub CarregarComboBoxChampions()

        Dim objChampions As New Negocios.Champions

        cbbChampions.DataSource = objChampions.RetornarListaChampions()

    End Sub

    Public Sub ConfigurarTextos()

        lblSelecionar.Text = Resources.RetornarTextos("SelecionarChampion")
        tbpEstatisticas.Text = Resources.RetornarTextos("Estatisticas")
        Me.Text = Resources.RetornarTextos("SelecaoChampion")
        lblHealth.Text = Resources.RetornarTextos("StatusVida")
        lblResource.Text = Resources.RetornarTextos("StatusRecurso")
        lblMovementSpeed.Text = Resources.RetornarTextos("StatusMovementSpeed")
        lblArmor.Text = Resources.RetornarTextos("StatusArmor")
        lblMagicResist.Text = Resources.RetornarTextos("StatusMagicResist")
        lblResourceType.Text = Resources.RetornarTextos("StatusTipoRecurso")
        lblHealthRegen.Text = Resources.RetornarTextos("StatusRegeneracaoVida")
        lblResourceRegen.Text = Resources.RetornarTextos("StatusRegeneracaoRecurso")
        lblRange.Text = Resources.RetornarTextos("StatusRange")
        lblAttackDamage.Text = Resources.RetornarTextos("StatusAttackDamage")
        lblAttackSpeed.Text = Resources.RetornarTextos("StatusAttackSpeed")
        lblAbilityPower.Text = Resources.RetornarTextos("StatusAbilityPower")

        lblSubTitulo.Text = Resources.RetornarTituloChampion(Negocios.Champions.TrataNomeChampion(cbbChampions.Text))

    End Sub

    Private Sub CarregarChampion(ByVal objChampion As Objetos.Champion)

        Dim strNomeChampion As String = Negocios.Champions.TrataNomeChampion(objChampion.Nome)

        lblNome.Text = objChampion.Nome
        lblSubTitulo.Text = Resources.RetornarTituloChampion(strNomeChampion)
        picChampion.ImageLocation = Resources.RetornarImagemChampion(strNomeChampion)

        txtHealth.Text = String.Format("{0} (+{1})", objChampion.HP_Base, objChampion.HP_Base_Level)
        txtResource.Text = String.Format("{0} (+{1})", objChampion.Recurso_Base, objChampion.Recurso_Base_Level)
        txtMovementSpeed.Text = String.Format("{0}", objChampion.Movement_Speed_Base)
        txtArmor.Text = String.Format("{0} (+{1})", objChampion.Armor_Base, objChampion.Armor_Base_Level)
        txtMagicResist.Text = String.Format("{0} (+{1})", objChampion.Magic_Resist_Base, objChampion.Magic_Resist_Base_Level)
        txtResourceType.Text = String.Format("{0}", objChampion.Tipo_de_recurso)
        txtHealthRegen.Text = String.Format("{0} (+{1})", objChampion.HP_Regen_Base, objChampion.HP_Regen_Base_Level)
        txtResourceRegen.Text = String.Format("{0} (+{1})", objChampion.Recurso_Regen_Base, objChampion.Recurso_Regen_Base_Level)
        txtRange.Text = String.Format("{0}", objChampion.Range)
        txtAttackDamage.Text = String.Format("{0} (+{1})", objChampion.Attack_Damage_Base, objChampion.Attack_Damage_Base_Level)
        txtAttackSpeed.Text = String.Format("{0} (+{1}%)", objChampion.Attack_Speed_Base, objChampion.Attack_Speed_Base_Level_Perc)
        txtAbilityPower.Text = String.Format("{0} (+{1})", objChampion.Ability_Power_Base, objChampion.Ability_Power_Base_Level)

    End Sub

#End Region

#Region "Eventos"

    Private Sub frmSelecaoChampion_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        ConfigurarTextos()
        CarregarComboBoxChampions()

    End Sub

    Private Sub cbbChampions_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbbChampions.SelectedIndexChanged

        Dim objChampion As Objetos.Champion = CType(cbbChampions.SelectedValue, Objetos.Champion)

        CarregarChampion(objChampion)

    End Sub

#End Region

End Class